<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@taglib prefix="sjg" uri="/struts-jquery-grid-tags"%>

<html>
<head>
<sj:head jqueryui="true" jquerytheme="redmond"></sj:head>
<script type="text/javascript">
	function okButton() {
		alert('OK Button pressed!');
	};

	function cancelButton() {
		alert('Cancel Button pressed!');
		$('#mybuttondialog').dialog('close');
	};

	function onClickCreat(){
		window.location="vCreatDepartment.action";
		}
	
	function okButtonDeactive(){
		$('#deactivedialog').dialog("close");
		}
	
	function cancelButtonDeactive(){
		$('#deactivedialog').dialog("close");
		}
	
	function onClickSave(){
		window.location="vSaveDirectorate.action";
	}
	
	function onClickBack(){
		window.location="vBackDirectorate.action";
	}
	
	$.subscribe('tabcomplete', function(event, ui) {
		$('#infopanel').html(
				'<strong>Completed request with Status '
						+ event.originalEvent.status
						+ '.</strong><br/>Status: '
						+ event.originalEvent.request.status);
	});
</script>
</head>
<body>
	<h3>Directorate Details</h3>
	<s:url id="detail" action="vDetailDirectorate"/>
	<s:url id="department" action="vDepartmentDirectorate"/>
	<sj:dialog id="deactivedialog"
		buttons="{ 
    		'OK':function() { okButtonDeactive(); },
    		'Cancel':function() { cancelButtonDeactive(); } 
    		}"
    	effect="true"
    	showEffect="drop" 
    	autoOpen="false" modal="true" title="Note">
     Do you want to mark this Directorate in-active?
    </sj:dialog>
	<s:form action="organisationDetail4Actions" theme="simple">
		<table style="text-align:right;">
			<tr>
				<td> <sj:a button="true" onclick="onClickDeactive()" openDialog="deactivedialog">Deactive</sj:a> </td>
				<td> <sj:a button="true" onclick="onClickSave()" >Save</sj:a> </td>
				<td> <sj:a button="true" onclick="onClickBack()" >Back</sj:a> </td>
			</tr>
		</table>
		<br>
		<br>
		<fieldset>
			<sj:tabbedpanel id="remotetabs" spinner="Please wait ..."
				disabledTabs="[2,3,4,5]" onCompleteTopics="tabcomplete"
				onChangeTopics="tabchange">
				<sj:tab id="tab1" href="%{detail}" label="Details" />
				<sj:tab id="tab2" href="%{department}" label="Departments" />
				
				
			</sj:tabbedpanel>
		</fieldset>
	</s:form>
</body>
</html>